const { generateTheme } = require('antd-theme-generator');
const path = require('path');

const options = {
  stylesDir: path.join(__dirname, './src'), //对应具体位置
  antDir: path.join(__dirname, './node_modules/antd'), //对应具体位置
  varFile: path.join(__dirname, './src/skin-default.less'), //对应具体位置
  mainLessFile: path.join(__dirname, './src/tantuer.less'), //对应具体位置
  themeVariables: [
    '@primary-color',
    '@layout-sider-background',
    '@layout-body-background',
    '@layout-header-background',
    '@item-hover-bg',
    '@menu-dark-bg',
    '@menu-dark-submenu-bg',
    '@menu-dark-item-active-bg',
    '@menu-dark-highlight-color',
    '@menu-dark-color',
    '@menu-dark-arrow-color',
    '@border-radius-base',
    '@color-split-l',
    '@color-split-r',
    '@component-background',
    '@table-header-bg',
    '@text-color',
    '@text-color-2',
    '@text-color-secondary',
    '@text-color-light',
    '@text-hd-color',
    '@text-hd-color-light',
    '@color-dark',
    '@login-area-bg-light',
    '@login-area-bg-start',
    '@login-area-bg-end',
    '@primary-color-6',
  ],
  indexFileName: 'index.html',
  outputFilePath: path.join(__dirname, './public/color.less'),
};

generateTheme(options)
  .then((less) => {
    console.log('Theme generated successfully');
  })
  .catch((error) => {
    console.log('Error', error);
  });
